import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import uView from '@/uni_modules/uview-ui'
import MyUtils from '@/utils/js/common'
import api from './api'


Vue.use(uView)
Vue.config.productionTip = false

console.log(api,666666)
Vue.prototype.uni = uni;
// 工具函数
Vue.prototype.$uploadUrl = 'https://px.aibaiba.com/api/';
// Vue.prototype.$uploadUrl = 'http://bbsf.test/api/';
Vue.prototype.$MyUtils = MyUtils;
Vue.prototype.$contentIsNull = MyUtils.contentIsNull;
Vue.prototype.$arrayIsNull = MyUtils.arrayIsNull;
const previewImage = (img)=> {
		uni.previewImage({
			urls: img,
			longPressActions: {
				success: function (data) {
					// console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
				},
				fail: function (err) {
					// console.log(err.errMsg);
				}
			}
		});
}
Vue.prototype.previewImage = previewImage;

const navigateTo = (url)=> {
		uni.navigateTo({
			url: '/pages/index/'+url,
		})
	}
Vue.prototype.navigateTo = navigateTo;

App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif